package com.example.ocridentification.controller;

import com.example.ocridentification.service.OwnershipService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;

@RestController
@RequestMapping("/ocr")
public class OcrController {
    @Autowired
    private OwnershipService ownershipService;
    @RequestMapping("/ownership")
    public String ownershipCertificate(@RequestParam("file") MultipartFile file) throws IOException {
        System.out.println(file.getOriginalFilename());
        return ownershipService.getData(file.getBytes());
    }
}
